/*
 * KmyRandom.h
 *
 *  Created on: 2012-12-11
 *      Author: KamiyaSoft
 */

#ifndef __KMY_RANDOM_H_
#define __KMY_RANDOM_H_

#include "KmyTypedef.h"

class KmyRandom {
public:
	KmyRandom(u64 seed);
	virtual ~KmyRandom();

    static KmyRandom* getInstance();

    void setSeed(u64 seed);
	u32 getRandom();
	u32 getRandom(u32 max);
	u32 getRandom(u32 min, u32 max);
private:
	u64 x;
	u64 mul;
	u64 add;

    static KmyRandom* instance;
};

#endif /* KMYRANDOM_H_ */
